package com.study.services;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.study.model.jdao.WarehouseJDao;
import com.study.model.mdao.WarehouseMapper;
import com.study.model.pojo.Warehouse;

@Service
public class WarehouseService {
	@Autowired
	WarehouseMapper wMapper;
	@Autowired
	WarehouseJDao wDao;
	
	
	//查询所有仓库信息
	public Warehouse findBywarId(String warId){
		return wDao.findBywarId(warId);
	}
	
	//查询所有仓库信息
	public List<Warehouse> findAll(){
		return wMapper.findAll();
	}
	
	//添加仓库
	public void addWarehouse(Warehouse warehouse) {
		wMapper.addWarehouse(warehouse);
	}
	
	//根据仓库类型查找
	public List<Warehouse> findByWarKind(String warKind){
		return wMapper.findByWarKind(warKind);
	}
	
	//删除仓库
	public void delWarehouse(String warId) {
		wMapper.delWarehouse(warId);
	}
	
	//修改状态
	public void editStatic(String warId) {
		wMapper.editStatic(warId);
	}
	
	//修改仓库
	public void editWarehouse(Warehouse warehouse) {
		wMapper.editWarehouse(warehouse);
	}
	
}
